<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2022/5/5
 * Time: 15:22
 */

namespace app\model\weixin;


use app\model\BaseModel;

class WeixinOpenRequestLog extends BaseModel
{
    protected $table = 'video_wechat_open_request_log';

    protected $primaryKey = 'wechat_open_id';

    public $timestamps = false;

    protected static $instance;

    public static function getInstance()
    {
        //        if(is_object(self::$instance)){
//            return self::$instance;
//        }

        return new self();
    }

    public function insertData($url,$param,$result,$apiName)
    {
        $insert = [
            'param'=>json_encode($param,256),
            'result'=>json_encode($result,256),
            'api_name'=>$apiName,
            'api_url'=>$url,
            'createtime'=>date('Y-m-d H:i:s'),
        ];

        return $this->insertGetId($insert);
    }
}